/**
 * com.hw.postgres.jdbc.ConnUtil.java
 */
package com.mbmed.doctor.commons.dao;

 /**
 * @file  ConnUtil.java
 * @author yangzhengxin(Jason)
 * @version 0.1
 * @todo	TODO
 * Copyright(C), 2013-2014
 *			Shenzhen Coordinates Software Development Co., Ltd
 * History
 *   	1. Date: 2013-11-19
 *      	Author: yangzhengxin(Jason)
 *      	Modification: this file was created
 *   	2. ...
 */
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

public class ConnUtil 
{ 
    public static Connection getConn() 
    { 
        Connection conn = null; 
        try 
        { 
            Class.forName("org.postgresql.Driver"); 
            String url = "jdbc:postgresql://localhost:5432/MyPGDB"; 
            try 
            { 
                conn = DriverManager.getConnection(url, "postgres", "root123"); 
            } 
            catch (SQLException e) 
            { 
                e.printStackTrace(); 
            } 
        } 
        catch (ClassNotFoundException e) 
        { 
            e.printStackTrace(); 
        } 
 
        return conn; 
    } 
 
} 